//
//  RefundCodeAlertView.m
//  wsgz
//
//  Created by huck on 16/8/22.
//  Copyright © 2016年 BoingPay. All rights reserved.
//

#import "RefundCodeAlertView.h"



@interface RefundCodeAlertView()<CustomIOSAlertViewDelegate>
{
    RefundCodeAlertContainer *contentView;
}

@end

@implementation RefundCodeAlertView

-(id)init{
    self = [super init];
    if (self) {
        [self initCustomView];
    }
    return  self;
}

-(void)initCustomView
{
    self.containerView = [self createAlertContentView];
    self.buttonTitles = @[@"确认"];
    self.delegate = self;
}

-(void)setCode:(NSString *)code1
{
    _code = code1;
    contentView.code = code1;
}

-(void)setTime:(NSString *)time1
{
    _time = time1;
    contentView.time = time1;
}

-(UIView*)createAlertContentView
{
    if(contentView==nil){
        contentView = [[[NSBundle mainBundle] loadNibNamed:@"RefundCodeAlertView" owner:self options:nil] firstObject];
    }
    return contentView;
}

#pragma mark CustomIOSAlertViewDelegate
- (void)customIOS7dialogButtonTouchUpInside:(id)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    [self close];
}

@end



/**
 *  ///////////////////内容容器////////////////////////////
 */

@interface RefundCodeAlertContainer()

@end

@implementation RefundCodeAlertContainer


-(void)setCode:(NSString *)code1
{
    _code =code1;
    _codeLabel.text = code1;
}

-(void)setTime:(NSString *)time1
{
    _time = time1;
    _timeLabel.text = [NSString stringWithFormat:@"有效时间%@分钟",time1];
}

@end
